Fix vl_dpo_gemma3 notebook execution bugs, JAX deprecations, and OOM memory allocation - #1739
Open
selamw1 wants to merge 1 commit into
Open
Fix vl_dpo_gemma3 notebook execution bugs, JAX deprecations, and OOM memory allocation#1739selamw1 wants to merge 1 commit into
selamw1 wants to merge 1 commit into
Conversation
selamw1
requested review from
abheesht17,
hgao327,
jiangyangmu,
lc5211,
s-noghabi,
sizhit2,
tianshub and
wang2yn84
as code owners
July 23, 2026 21:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves critical execution failures, API deprecations, memory allocation errors, and variable mismatches in the DPO training notebook. The changes ensure reliable, error-free end-to-end training while maximizing accelerator resource efficiency.
Key Changes
1. Runtime & Logic Fixes
jax.sharding.AxisType.Autoto resolveNamedShardingValueError.AttributeErrorwith theSentencePieceProcessorduring tokenizer initialization #1719 to prevent attribute errors during execution..repeat(EPOCHS)totrain_dsto prevent early training termination after epoch 1.NameErrorby importingorbax.checkpointasocp, and aligned trainer calls todpo_trainer.train().image_processorfromDPOTrainerinitialization to fix image array conversionTypeError.2. Resource & Performance Optimization
BATCH_SIZEfrom2to1to fit within memory constraints and eliminate JAXRESOURCE_EXHAUSTEDallocation failures injit_compute_logps.3. API Deprecation Upgrades
with mesh:syntax towith jax.set_mesh(mesh):.checkpointing_optionswithsave_decision_policy.4. Usability & Documentation